perm filename INTARG.PAL[AL,HE] blob sn#368751 filedate 1978-07-21 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	.SBTTL	Table of interpreter instructions
C00014 ENDMK
C⊗;
.SBTTL	Table of interpreter instructions

COMMENT  ⊗
This table is parallel to the file INTDEF.SAI[AL,HE].  It is required
at several places in the interpreter; each of these can define the
macro MAKEOP however desired.  The convention here for types of
arguments that each pseudo-op takes is this:
	a	absolute address
	la	list of absolute addresses
	o	offset or level-offset pair
	lo	list of offsets or level-offset pairs
	n,t	small constants
	r50	word of radix 50
⊗

COMMENT  ⊗ HN
Following convention is used for Number-of-arguments indicators (appearing before
the "types of arguments" in <>s):
	
	0 - 6	actual No. of arguments
	7	No. of arguments to be found depending on the pcode,
		(usually a list of arguments)

			-----------------------

NOTE 2 : PRELOAD expression for array OPCODES in page 3 of file DEBAL.SAI[AL,HE] is
     also parallel to this file and a change to this file should be reflected there
     accordingly.
			-----------------------
⊗

PCVERSION == 8		;Fix this every time you add some new pcodes

	II == 2		;Start of interpreter jump table (0 is illegal instruction)

	;Motion control
MAKEOP	XMOVE,MOVE,2,<a,n>	;Prepare, execute move whose traj table is at a.
MAKEOP	XCENTER,CENTER,2,<a,n>,	;Center using traj table at a, using mech n.
MAKEOP	XSTOP,STOP,1,<n>	;Cause all mechanisms whose bits are on in n to stop.
MAKEOP	XTFRCST,TFRCST,1,<n>	;Initializes force system, force frame on stack
				; control bits in <n>
MAKEOP	XVMKFRC,VMKFRC,0	;Gets vector off stack, makes a force frame along vector
			; and puts it on the stack
MAKEOP	XCOMPLY,COMPLY,1,<n>	;Sets up compliant motion in next move
				;Gets force magnitude off stack, control bits in <n>
MAKEOP	XCMPOFF,CMPOFF,1,<n>	;Turns off compliant motion in current move (not used)
MAKEOP	XNOTICE,NOTICE,0	;Make sure everyone knows where the arm is.
MAKEOP	XFILL0,NOOP,0		;filler

	;Variables
MAKEOP	XMVAR,MVAR,7,<<t,n,...>>	;Make n variables of type t with possible 
				;  optional arguments (list arg)
MAKEOP	XKVAR,KVAR,1,n	;Kill last n environment entries

	;Stack operations
MAKEOP	XGTVAL,GTVAL,1,<o>;Push value of arg (level-offset pair).
MAKEOP  XCHNGE,CHNGE,1,<o>;Pop value into arg (level-offset pair).
MAKEOP	XPUSH, PUSHV,1,<a> ;Push arg directly (as a ptr) onto stack. For cnstnts.
MAKEOP	XPOP,  POPV, 0	;Pop stack.
MAKEOP	XCOPY, COPY ,1,<n>;Copy n'th down to top of stack.
MAKEOP	XREPLAC,REPLAC,1,<n>	;Replace n'th down with top (which pop)

	;Flow of control
MAKEOP	XJUMP, JUMP,1,<a>	;Jump to address
MAKEOP	XJUMPC,JUMPC,1,<a>	;Jump to address if "true"
MAKEOP	XTERMINATE,TERMINATE,0	;Terminate this interpreter
MAKEOP  XPROC, PROC,7,<a,lo>	;Call a procedure at a, with arg list lo 
MAKEOP	XRETURN,RETURN,1,<n>	;Return from procedure
MAKEOP	XSPROUT,SPROUT,7;la	;Sprout interpreters at each arg, wait (list arg)
MAKEOP	XFORCHK,FORCHK,1,<a>	;Do a FOR-loop check, and fail to location d.
MAKEOP	XCASE,CASE,7,<n,la>	;Does a regular case statement dispatch
MAKEOP	XSIGNAL,SIGNAL,1,<o>	;Signal event at level-offset o.
MAKEOP	XWAITE,WAITE,1,<o>	;Wait on event at level-offset o.
MAKEOP	XPAUSE,PAUSE,0		;Pause in seconds (on stack)
MAKEOP	XABORT,ABORT,0		;Abort current motions
MAKEOP	XDDT,GODDT,0		;go to DDT.
MAKEOP	XFILL1,NOOP,0		;filler
MAKEOP	XFILL2,NOOP,0		;filler
MAKEOP	XINT,INT,0		;s ← INT s (integer part of)

	;Affixment
MAKEOP	XAFFIX,AFFIX,3,<o,o',n (,o")>   ;Makes an affixement of type n between two
				;  frames at level-offsets o & o' (trans at o")
MAKEOP	XUNFIX,UNFIX,2,<o,o'>	;Unfixes the two frames at level-offsets: o & o"

	;Boolean
MAKEOP	XSLE,SLE,0	;S≤S  compare top two elts, pop, pop, push answer
MAKEOP	XSLT,SLT,0	;S<S		true := 1.0
MAKEOP	XSGE,SGE,0	;S≥S		false:=  0
MAKEOP	XSGT,SGT,0	;S>S
MAKEOP	XSEQ,SEQ,0	;S=S
MAKEOP	XSNE,SNE,0	;S≠S
MAKEOP	XAND,AND,0	;S∧S  (logical and)
MAKEOP	XLOR,LOR,0	;S∨S  (logical or)
MAKEOP	XNOT,NOT,0	;¬S   (logical not) note: this only takes one arg
MAKEOP	XXOR,LXOR,0	;S⊗S  (logical exclusive or)
MAKEOP	XEQV,EQV,0	;S≡S  (logical equivalence)

	;Arithmetic
MAKEOP	XWHERE,WHERE,1,<n>	;Push the current location of mechanism n
MAKEOP	XSADD, SADD, 0	;S+S:  Add top two elts, pop, pop, push answer
MAKEOP	XSSUB, SSUB, 0	;S-S:  Sub top two elts, pop, pop, push answer
MAKEOP	XSNEG, SNEG, 0	;-S:   Negate top elt, pop, push answer
MAKEOP	XSMUL, SMUL, 0	;S*S:  Mul top two elts, pop, pop, push answer
MAKEOP	XSDIV, SDIV, 0	;S/S:  Div top two elts, pop, pop, push answer
MAKEOP	XSEXP,NOOP,0	;S↑S:  Raise scalar to a power		***TO DO***
MAKEOP	XSABS,SABS,0	;|S|:  Absolute value of a scalar
MAKEOP	XVMAGN, VMAGN,0	;S ← norm of vector
MAKEOP	XVDOT, VDOT,0	;S ← vector dot vector
        ;PVDOT	;S ← vector dot vector all 4 cells
MAKEOP	XSSBRTN,SSBRTN,1,<n>	;S ← SBRTN[n](top scalar elt)
MAKEOP	XTMAGN,TMAGN,0	;S ← extracts angle of rotation from trans
MAKEOP	XTAXIS,TAXIS,0	;V ← extracts axis of rotation from trans
MAKEOP	XVMAKE,VMAKE,0	;V ← vector(scalar,scalar,scalar)
MAKEOP	XSVMUL,SVMUL,0	;V ← scalar * vector
MAKEOP	XVSDIV,VSDIV,0	;V ← vector / scalar
MAKEOP	XVADD, VADD,0	;V ← vector + vector
MAKEOP	XVSUB, VSUB,0	;V ← vector - vector
MAKEOP	XUNITV,UNITV,0	;Vector ← vector / its norm
MAKEOP  XCROSV,CROSV,0	;Vector ← vector cross vector
MAKEOP	XTVMUL,TVMUL,0	;Vector ← trans * vector
MAKEOP	XTPOS,TPOS,0	;Vector ← translation_part_of_trans
MAKEOP	XTORIEN,TORIEN,0;T ← rotation_part_of_trans
MAKEOP	XVSAXWR,VSAXWR,0;T ← rotation(vector,angle)
MAKEOP	XTMAKE,TMAKE,0	;T ← trans(rot,vector)
MAKEOP	XTVADD,TVADD,0	;T ← t + v
MAKEOP	XTVSUB,TVSUB,0	;T ← t - v
	;FTOF		;T ← INV(t1) * t2  done by TTMUL(TINVRT(t1),t2) in pcode
MAKEOP	XTTMUL,TTMUL,0	;T ← trans * trans
MAKEOP	XTINVRT,TINVRT,0;T ← inverse(trans)
MAKEOP	XCONSTR,CONSTR,0;T ← construct(v,v,v)
MAKEOP	XMAX,MAX,0	;s ← s MAX s
MAKEOP	XMIN,MIN,0	;s ← s MIN s
MAKEOP	XIDIV,IDIV,0	;s ← INT(INT(s)/INT(s))
MAKEOP	XMOD,MOD,0	;s ← s MOD s

	;Condition monitors
MAKEOP	XCMENBL,CMENBL,1,<o>	;Enable c-m at level-offset o
MAKEOP	XCMDSBL,CMDSBL,1,<o>	;Disable c-m at level-offset o
MAKEOP	XCMTRIG,CMTRIG,0	;Trigger the c-m body (use only in checker)
MAKEOP	XCMSKED,CMSKED,1,<n>	;Sleep for n mills (use only in checker)
MAKEOP	XCMUNCR,CMUNCR,0	;Start uncritical section
MAKEOP	XCMDONE,CMDONE,0	;Ends force/hardware/duration c-m's, if c-m was
				; re-enabled then restarts it, else dismisses it
MAKEOP	XCMFORCE,CMFORCE,0	;Initialize force sensing - vector & level on stack
MAKEOP	XCMSENSE,CMSENSE,0	;Initialize hardware sensing
MAKEOP	XCMDUR,CMDUR,0		;Wait for set time, then start up c-m
MAKEOP	XFILL8,NOOP,0		;filler	(for hardware cmons?)
MAKEOP	XFILL9,NOOP,0		;filler	(for hardware cmons?)

	;Initialization
MAKEOP	XPROG,PROG,0		;Initialize mechanism variables
MAKEOP	XENDP,ENDP,0		;Clean up mechanism variables

	;Input/Output
MAKEOP	XPROMPT,PROMPT,0	;Wait for a "P" on VT05 before proceeding
MAKEOP	XSCALRD,SCALRD,0	;Read in a scalar from the terminal
MAKEOP	XPRINT,PRINT,1		;Type an ASCIZ string on the VT05.
MAKEOP	XVALPRN,VALPRN,0	;Type a value, whatever type it is, and pop it.
MAKEOP	XVARPRN,VARPRN,1,<o>	;Type a variable (level-offset), whatever type.
MAKEOP	XQUERY,QUERY,0		;Read in a boolean from the VT05 - either "Y" or "N"
MAKEOP	XFIL10,NOOP,0		;filler
MAKEOP	XFIL11,NOOP,0		;filler

	;Debugging aids
MAKEOP	XBRACE,BRACE,0	;Bracepoint in the program (break or trace)
MAKEOP	XNOOP,NOOP,0	;Null operation
MAKEOP	XTOPAL,TOPAL,0	;Escape to PAL